package demo;

import java.util.Scanner;

public class GcdLcm {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int n = scanner.nextInt();
        // m=120, n=56

//        GCD
        for (int i = Math.max(m, n); i > 0; i--) {
            if (m % i == 0 && n % i == 0) {
                System.out.println(i);
                break;
            }
        }

//        LCM
        for (int i = Math.max(m, n);  ; i++) {
            if (i % m == 0 && i % n == 0) {
                System.out.println(i);
                break;
            }
        }
    }
}
